package com.nan.leetcode;

public class Test8 {
    public int removeDuplicates(int[] nums) {
        int index=1;
        for(int i=1;i< nums.length;i++){
            if(nums[i]!=nums[i-1]){
                nums[index]=nums[i];
                index++;
            }
        }
        return index;
    }

    public static void main(String[] args) {
        Test8 test8 = new Test8();
        int[] array=new int[]{0,0,1,1,1,2,2,3,3,4};
        int y = test8.removeDuplicates(array);
        System.out.println(y);
    }
}
